#include "libservice.h"
#include "../build/genericFactory/soapH.h"

int factory_adapt(char *app, char *id, char *target,
		char *genericFactoryAddress, char*state_store_location) {
	struct soap *soap = soap_new();
	char * targetWSDL;

	if (soap_call_ns__adapt(soap, genericFactoryAddress, NULL, app, "", id,
			target, state_store_location, &targetWSDL) != SOAP_OK)
		soap_print_fault(soap, stderr);
	else {
		fprintf(stderr, "[soap] new service's location is %s\n", targetWSDL);

	}
	soap_destroy(soap);
	soap_end(soap);
	soap_done(soap);
	return 0;
}
